isAPIError.spec.js ➔ ???   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 5
Bugs 0 Features 0
Metric Value
cc 1
c 5
b 0
f 0
nc 1
dl 0
loc 3
rs 10
nop 1
1
import test from 'ava';
2
import { isAPIError } from '../../src/utils';
3
import APIError from 'unity-api/dist/error';
4
5
test('APIError', t => {
6
    t.true(isAPIError(new APIError()))
7
});
8
9
test('standard error', t => {
10
    t.false(isAPIError(Error()))
11
});
12
13
test('standard new error', t => {
14
    t.false(isAPIError(new Error()))
15
});
16
17
test('plain object', t => {
18
    t.false(isAPIError({}))
19
});
20
21
test('number', t => {
22
    t.false(isAPIError(1))
23
});